﻿CREATE PROCEDURE [dbo].[Schedule_Select]
	@CourseSemesterId int = null,
	@StudentId int=null
AS
SELECT Courses.Name, StudentCourse.CourseSemesterId, CourseSemester.CourseId, CourseSemester.DoctorId , StudentCourse.StudentId
FROM Courses INNER JOIN CourseSemester ON Courses.ID = CourseSemester.CourseId INNER JOIN StudentCourse ON CourseSemester.Id = StudentCourse.CourseSemesterId 
WHERE (StudentCourse.CourseSemesterId = @CourseSemesterId) AND (StudentCourse.StudentId = @StudentId)